
Learn how to implement the marching squares algorithm to generate diggable terrain in Unity, including corner states, mesh generation, interpolation for smoothing, and building a grid of configurations.
Build a 2d Unity project to create procedural meshes from four vertices and triangles, forming a square, and visualize the vertices with gizmos while adjusting with a grid scale.
Create a square mesh from scratch by defining vertices and triangles in Unity, then assign it to a mesh filter and render it in the scene.
Define center vertices (top, right, bottom, left) and mirror them in Unity, display with gizmos, to create a procedural mesh from scratch using code for a diamond shape.
Implement a four-corner configuration in Unity by adding boolean corner states, computing a bitmask with getConfiguration using bitwise logic, and preparing to set up vertices and triangles from the configuration.
Apply marching squares to triangulate a square by configuring vertices and triangles in Unity, using lists and vectors, to generate dynamic, interpolated terrain.
Learn to interpolate center vertex positions using a threshold to shape smooth terrains, applying linear interpolation and the inverse lerp method.
Explore interpolating center vertices with an iso value in a marching squares setup in Unity, using top/bottom left/right values and clamped lerps to render a scalar field.
Create a scalar field to drive terrain in Unity by building a grid of float values, and visualize it with gizmos and world position mapping.
Learn to implement interactive grid in Unity by displaying grid values in the scene, adding an input manager with raycast clicks, and triggering world position events to modify the terrain.
Learn to edit the terrain's scalar field by converting world clicks to grid coordinates, applying a circular stamp to nearby cells, and guarding bounds with a valid grid position check.
Apply a circular stamp with a configurable brush radius and strength to edit multiple grid cells at once, decreasing values to dig terrain and connect to marching squares.
Refactor the square script into a struct that holds square data and merges the scalar field with marching squares. Triangulate with an isovalue and values array, exposing vertices and triangles.
Build a square grid structure that holds squares and triangulates them into vertices and triangles, then visualize by generating a mesh with a mesh filter using isovalue and grid scale.
Fix the terrain generator by clearing vertices and triangles before updating the mesh, then adjust grid size and grid scale to achieve smooth, real-time updates.
Improve terrain visuals with a new unlit material and vibrant colors, and optimize performance by chunking terrain, refining carving with an exponential brush, and generating efficient meshes and colliders.
Add UVs to the terrain, import a texture, and switch to an unlit shader to display the digging surface with proper texture mapping.
Adjust tiling and grid scale to keep the toad texture inside each square. Center the texture by offsetting UVs by half the grid scale, so it occupies a single square.
Apply textures to the terrain generator by adjusting tiling and UVs, using grid size and grid size minus one to align texture across multiple terrain sections.
Learn to scale and offset UVs to control tiling in Unity, adjust with UV scale, and regenerate terrain meshes using the node attributes library and on value changed events.
Develop a terrain manager to spawn and initialize terrain generators as a grid, apply textures across all generators, and center them using grid size and world size calculations.
Apply the texture to the whole terrain by calculating per-generator UV offsets on a grid, dividing UVs by grid size, and offsetting each segment for seamless tiling.
You !
Yeah, you!
You want to be a Better Developer right ?
You want to give more Creativity to your players, allow them to Shape & Carve Worlds ?
You want to be a bit Faster at creating worlds ?
Then this course is for You!
Astroneer, No Man’s Sky & Minecraft use Procedural Mesh Generation to create worlds.
Mobile games such as Sand Balls, Alto’s Adventure & Castle Raid are hit games, and also use the Marching Squares Algorithm to shape their levels & give more creativity to the player.
The potential behind these algorithms is Huge & is a big Time saver for developers like you.
This is why I decided to craft this course, so that you too, can learn how to create your own version of the Marching Squares Algorithm.
Together, we will do it Step-By-Step.
We will first learn how to Create a Procedural Mesh in Unity. You will understand the concepts of Vertices, Triangles and how to master them.
After making a simple Square, we will add a bit more points to our Mesh and make a One Square Version of the Marching Squares Algorithm. This will allow you to fully master the concept.
After Mastering the Square, we will create a simple Scalar Field (which is a fancy term for saying a field of values (I also explain in simple terms don’t worry, I hear you)).
We will be able to Display the Field of Values using Unity’s Gizmos system ( You might use that in almost any of your game to Debug stuff )
And finally, we will Merge our two systems [ The Scalar Field - The Marching Squares ] to be able to create a Fun 2D Digging System.
Time is precious, that’s why I decided to cover the aspects of this course in Under 3 Hours. You will be able to implement the system (and maybe make a quick 2D game if you’re hyped !) in less than a day.
If you ever need help, leave a comment and I’ll help asap ;).
Wanna start creating Procedural Worlds ? Click the Purple Button to your right !